package com.example.scity;

import androidx.annotation.NonNull;
import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.text.Html;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.ListView;
import android.widget.TextView;

import com.bumptech.glide.Glide;
import com.example.scity.beens.MovieBeen;
import com.example.scity.beens.QbddListBeen;
import com.google.gson.Gson;

import java.io.IOException;

import okhttp3.Call;
import okhttp3.Callback;
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.Response;

public class DdlbActivity extends AppCompatActivity {
   /* ListView listView;
    QbddListBeen qbddListBeen;
    Handler handler=new Handler(){
        @Override
        public void handleMessage(@NonNull Message msg) {
            super.handleMessage(msg);
            switch (msg.what){
                case 0:
                    QnddListView();
                    break;
            }
        }
    };
    private void QnddListView() {
        listView.setAdapter(new BaseAdapter() {
            @Override
            public int getCount() {
                return qbddListBeen.rows.size();
            }

            @Override
            public Object getItem(int i) {
                return qbddListBeen.rows.get(i);
            }

            @Override
            public long getItemId(int i) {
                return i;
            }

            @Override
            public View getView(int i, View view, ViewGroup viewGroup) {
                view = LayoutInflater.from(DdlbActivity.this).inflate(R.layout.item_qbddlist, null);
                TextView name;
                name = view.findViewById(R.id.qbdd_name);
                name.setText(qbddListBeen.rows.get(i).name);
                TextView orderNo;
                orderNo = view.findViewById(R.id.qbdd_orderNo);
                orderNo.setText(qbddListBeen.rows.get(i).orderNo);
                TextView orderStatus;
                orderStatus = view.findViewById(R.id.qbdd_orderStatus);
                orderStatus.setText(qbddListBeen.rows.get(i).orderStatus);
                TextView payTime;
                payTime = view.findViewById(R.id.qbdd_payTime);
                payTime.setText(qbddListBeen.rows.get(i).payTime);
                TextView orderTypeName;
                orderTypeName = view.findViewById(R.id.qbdd_orderTypeName);
                orderTypeName.setText(qbddListBeen.rows.get(i).orderTypeName);
                TextView amount;
                amount = view.findViewById(R.id.qbdd_amount);
                amount.setText(qbddListBeen.rows.get(i).amount);
                return view;
            }
        });
    }*/

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_ddlb);
        //listView = findViewById(R.id.ddlblistview);
       // LoadQbddlist();
    }
    /*private void LoadQbddlist() {
        OkHttpClient okHttpClient = new OkHttpClient();
        Request request = new Request.Builder()
                .url(Configs.Host + APIInterface.QBDDList)
                .get()
                .build();
        okHttpClient.newCall(request).enqueue(new Callback() {
            @Override
            public void onFailure(@NonNull Call call, @NonNull IOException e) {

            }

            @Override
            public void onResponse(@NonNull Call call, @NonNull Response response) throws IOException {
                qbddListBeen = new Gson().fromJson(response.body().string(), QbddListBeen.class);
                handler.sendEmptyMessage(0);
            }
        });
    }*/
}